package com.hsteach.enums;

import com.hsteach.dao.domain.wage.WageTemplateItems;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

@Getter
@AllArgsConstructor
public enum WageDefaultTemp1Enum {

    ITEM1(1L, "姓名", "xm",WageItemTypeEnum.OTHER,0,1),
    ITEM2(2L, "身份证号", "sfzh",WageItemTypeEnum.OTHER,0,1),
    ITEM3(3L, "工资应发数", "gzyfs",WageItemTypeEnum.ACCRUED,0,1),
    ITEM4(4L, "扣缴个人所得税", "kjgrsds",WageItemTypeEnum.DEDUCTION,0,1),
    ITEM5(5L, "个人缴住房公积金", "grjzfgjj",WageItemTypeEnum.DEDUCTION,0,1),
    ITEM6(6L, "个人缴社保", "grjsb",WageItemTypeEnum.DEDUCTION,0,1),
    ITEM7(7L, "工资实发数", "gzsfs",WageItemTypeEnum.OTHER,0,1),
    ITEM8(8L, "单位缴住房公积金", "dwjzfgjj",WageItemTypeEnum.OTHER,0,1),
    ITEM9(9L, "单位缴社保", "dwjsb",WageItemTypeEnum.OTHER,0,1),
    ITEM10(10L, "劳务合同签约单位(购买社保的单位)", "lwhtqydw",WageItemTypeEnum.OTHER,0,1),
    ;

    private Long orderId;
    private String itemName;
    private String itemCode;
    private WageItemTypeEnum itemType;
    private Integer itemSource;
    private Integer status;

    public static List<WageTemplateItems> getDefaultItems(Long templateId) {
        return Arrays.stream(WageDefaultTemp1Enum.values()).map(e -> {
            WageTemplateItems item = new WageTemplateItems();
            item.setTemplateId(templateId);
            item.setItemCode(e.getItemCode());
            item.setOrderId(e.getOrderId());
            item.setItemName(e.getItemName());
            item.setItemType(e.getItemType().getCode());
            item.setItemSource(e.getItemSource());
            item.setStatus(e.getStatus());
            return item;
        }).collect(Collectors.toList());
    }
}
